import argparse
import pickle

if __name__ == '__main__':
    # create the parser
    parser = argparse.ArgumentParser(
        description='Print the contents of a snip file (for debugging purposes)')

    # add the arguments
    parser.add_argument(
        'snipfile', metavar='input', type=argparse.FileType('r'), nargs=1,
        help='snipfile to be printed')

    # parse the command line
    args = parser.parse_args()

    snips = pickle.load(args.snipfile[0])

    for key, value in snips.iteritems():
        print "%s:" % key
        print "*" * 40
        print value
